package contas;

import exceptions.SaldoInsuficienteException;

public class ContaImposto extends Conta {

	private static final long serialVersionUID = 1L;
	private static double TAXA = 0.01;
	
	public ContaImposto(String numero) {
		this(numero, 0.0);
	}
	public ContaImposto(String numero, double valor) {
		super(numero, valor);
	}

	public void debitar(double valor) throws SaldoInsuficienteException {
		if (valor*(1+TAXA) > super.getSaldo()) {
			throw new SaldoInsuficienteException(super.getSaldo(), super.getNumero());
		} else {
			super.setSaldo(super.getSaldo() - valor*(1+TAXA));	
		}
	}
}
